<!-- 开放管理-基地信息-研学课程 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="基地名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="课程名称">
              <el-input v-model="listQuery.fuser" placeholder="课程名称" clearable />
            </el-form-item>
          </el-col>

          <template v-if="showAll">
          <el-col :span="6">
            <el-form-item label="课程类型">
              <el-select v-model="listQuery.fcusttype" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </template>

          <el-col :span="6">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <!-- <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button> -->
              <!-- <el-button type="success" icon="el-icon-download">导出</el-button> -->
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FMEMO" label="基地名称"></el-table-column>
          <!-- <el-table-column prop="FCATNO" label="课程编号" width="105"></el-table-column> -->
          <el-table-column prop="FCATNAME" label="课程名称" ></el-table-column>
          <!-- <el-table-column prop="FUSER" label="机构名称" ></el-table-column> -->
          <el-table-column prop="FTITLE" label="课程主题" ></el-table-column>
          <!-- <el-table-column prop="FNOTE" label="课程目标" ></el-table-column> -->
          <!-- <el-table-column prop="FBILLTYPE" label="类型" width="80"></el-table-column> -->
          <el-table-column prop="FSCHOOL" label="接待学校数" width="85"></el-table-column>
          <el-table-column prop="FNUM" label="接待学生数" width="85"></el-table-column>
          <el-table-column prop="FGOOD" label="好评数" width="85"></el-table-column>
          <el-table-column prop="FBAD" label="差评数" width="85"></el-table-column>
          <el-table-column prop="FTOTAL" label="总评价" width="85"></el-table-column>
          <el-table-column prop="FUPDDATE" label="刷新时间" width="135"></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="105">
            <template slot-scope="scope">
              <el-button type="text" @click="insert(scope.row.FBILLNO)" size="small" icon="el-icon-edit">
                查看
              </el-button>
             <!-- <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm> -->
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '申请中'
        }, {
          value: '2',
          label: '已通过'
        }, {
          value: '3',
          label: '已驳回'
        }],

        customlist:[
          {
            "FBILLNO": "K241130001", 
            "FBILLCREDATE":"2024-11-30",
            "FUSER": "曹操",
            "FMEMO": "有机化学实验操作课",
            "FBEGDATE": "2024-12-01",
            "FENDDATE": "2025-11-30",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FNOTE":"",
            "FBILLSTATE": "申请中"
          },
        ],
        //1.带孩子们把中国古代艺术的发展过程搞明白2.提高对艺术作品的鉴赏水平3.
        list: [
            {
            "FCATNO": "SH240101", 
            "FCATNAME":"上海博物馆研学",
            "FUSER": "上海文化之旅研学机构",
            "FMEMO": "上海博物馆",
            "FTITLE": "上海博物馆",
            "FNOTE": "培养孩子对传统文化的喜爱",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FBILLTYPE":"历史",
            "FBILLSTATE": "正常",
            "FSCHOOL": "10",
            "FNUM": "6890",
            "FGOOD": "2502",
            "FBAD": "53",
            "FTOTAL": "优秀",
            "FUPDDATE":"2025-03-15 20:15:09"
            },{
            "FCATNO": "SH240102", 
            "FCATNAME":"上海国际汽车城研学",
            "FUSER": "上海文化之旅研学机构",
            "FMEMO": "上海国际汽车城",
            "FTITLE": "2025年新能源汽车展",
            "FNOTE": "让青少年接触最新的新能源汽车技术",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FBILLTYPE":"科创",
            "FBILLSTATE": "正常",
            "FSCHOOL": "2",
            "FNUM": "890",
            "FGOOD": "800",
            "FBAD": "90",
            "FTOTAL": "良好",
            "FUPDDATE":"2025-03-15 20:15:09"
            },
            ,{
            "FCATNO": "SH240103", 
            "FCATNAME":"上海交大生物转基因科创教育基地",
            "FUSER": "上海科技研学基地",
            "FMEMO": "上海交大生物转基因科创教育基地",
            "FTITLE": "2025年新生物制药",
            "FNOTE": "带领青少年了解生物技术",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FBILLTYPE":"科创",
            "FBILLSTATE": "正常",
            "FSCHOOL": "8",
            "FNUM": "5698",
            "FGOOD": "4200",
            "FBAD": "128",
            "FTOTAL": "良好",
            "FUPDDATE":"2025-03-15 20:15:09"
            },{
            "FCATNO": "SH240105", 
            "FCATNAME":"长岛庄园户外拓展基地",
            "FUSER": "上海科技研学基地",
            "FMEMO": "长岛庄园户外拓展基地",
            "FTITLE": "2025年户外探险之旅",
            "FNOTE": "带领青少年到户外探险",
            "FCHECKUSE": "",
            "FCHECKDATE": "",
            "FBILLTYPE":"户外",
            "FBILLSTATE": "正常",
            "FSCHOOL": "8",
            "FNUM": "5698",
            "FGOOD": "4200",
            "FBAD": "128",
            "FTOTAL": "良好",
            "FUPDDATE":"2025-03-15 20:15:09"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
      view(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>